﻿<Window x:Class="Ipmce.RemoteVoting.Frontend.VotingApplication.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Приложение для удалённого голосования" Height="350" Width="725">
    
    <Window.Resources>
		<ResourceDictionary Source="MainWindowResources.xaml"/>
    </Window.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ComboBox Grid.Row="0" Name="AuthorizationComboBox" Margin="5,5,5,0"
                          ItemsSource="{Binding Path=AuthorizationMethods}" DataContext="{Binding}" 
                          SelectedIndex="{Binding Path=SelectedAuthorizationMethod}"/>
                <TabControl Grid.Row="1" SelectedIndex="{Binding Path=SelectedAuthorizationMethod}" Margin="5,0,5,5">
                    <TabItem Visibility="Hidden" Content="{Binding Path=CertificateAuthorization}"/>
                    <TabItem Visibility="Hidden" Content="{Binding Path=PassportAuthorization}"/>
                </TabControl>
            </Grid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Label Grid.Row="0" Margin="5,2,5,5">Список кандидатов:</Label>
				<ListBox Grid.Row="1" Margin="5,1,5,0" ItemsSource="{Binding Path=CandidateNameList}" SelectedIndex="{Binding Path=SelectedCandidateIndex}"/>
                <Button Grid.Row="2" Content="{Binding Path=VoteCommand.DisplayName}" Command="{Binding Path=VoteCommand.Command}"/>
            </Grid>
        </Grid>
        <StatusBar VerticalAlignment="Bottom" Grid.Row="1" Background="Beige"
                   BorderThickness="1" BorderBrush="LightSlateGray">
            <StatusBarItem HorizontalAlignment="Right">Время голосования : </StatusBarItem>
            <StatusBarItem Content="{Binding Path=CurrentDateTime}" ContentTemplate="{StaticResource CurrentDateTimeTemplate}"/>
        </StatusBar>
    </Grid>
</Window>
